package com.jian.ecommercial.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.jian.ecommercial.domain.Stock;
import com.jian.ecommercial.mapper.StockMapper;
import com.jian.ecommercial.service.StockService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class StockServiceImpl implements StockService {
    @Autowired
    StockMapper stockMapper;

    @Override
    public PageInfo<Stock> list(int pageNum,String pt_date) {
        PageHelper.startPage(pageNum, 15);
        List<Stock> stockList = stockMapper.getStockList(pt_date);
        PageInfo<Stock> pageInfo = new PageInfo<>(stockList,5);
        return pageInfo;
    }
}
